import { BaseEntity } from 'src/common/base.entity'
import { Entity, Column, OneToOne } from 'typeorm'
import { Gender } from '../enums/gender.enum'
import { User } from './user.entity'

@Entity()
export class Profile extends BaseEntity {
  @Column({ unique: true })
  nickname: string

  @Column({ nullable: true })
  avatar?: string

  @Column({
    type: 'enum',
    enum: Gender,
    default: [Gender.UNKNOWN]
  })
  gender?: Gender

  @OneToOne(() => User, (user) => user.profile)
  user: User
}
